chore: Prevent conflict between clang-format and MSVC by wrapping inline assembly blocks in curly braces#2811
Merged
Conversation
xezon
approved these changes
Jun 19, 2026
|
Is the change title accurate? Why is it labelled as accomodating the MSVC parser? Isn't it accomodation clang format instead? |
Author
|
Clang doesn't throw warnings or errors, it is perfectly happy working with these files. It is the MSVC compiler parser that fails to compile the resulting formatted code. Both titles are accurate depending on perspective and what someone feels it should communicate. Feel free to change the title if you prefer! |
|
Tweaked |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When running
clang-formaton the codebase, it collapses consecutive unbraced inline__asmstatements onto a single line.If a standard C++ statement (such as
return) immediately follows, it also gets merged onto that same line.This PR prepares the codebase for the upcoming formatting baseline pass by isolating the inline assembly instructions into standard braced blocks (__asm { ... }).
When running the updated clang-format recursively across the entire repository (Core/, Generals/, GeneralsMD/, and scripts/), these are the only two files that required syntax adjustments to compile successfully on both modern VS2022 and legacy VC6 toolchains. This avoids adding //clang-format off.